﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using Helpers;
using TaleWorlds.CampaignSystem.Actions;
using TaleWorlds.CampaignSystem.CharacterDevelopment;
using TaleWorlds.CampaignSystem.ComponentInterfaces;
using TaleWorlds.CampaignSystem.Party;
using TaleWorlds.CampaignSystem.Party.PartyComponents;
using TaleWorlds.CampaignSystem.Settlements;
using TaleWorlds.Core;
using TaleWorlds.Library;
using TaleWorlds.LinQuick;
using TaleWorlds.Localization;
using TaleWorlds.ObjectSystem;
using TaleWorlds.SaveSystem;

namespace TaleWorlds.CampaignSystem
{
	// Token: 0x02000058 RID: 88
	public sealed class Clan : MBObjectBase, IFaction
	{
		// Token: 0x06000983 RID: 2435 RVA: 0x000391F5 File Offset: 0x000373F5
		internal static void AutoGeneratedStaticCollectObjectsClan(object o, List<object> collectedObjects)
		{
			((Clan)o).AutoGeneratedInstanceCollectObjects(collectedObjects);
		}

		// Token: 0x06000984 RID: 2436 RVA: 0x00039204 File Offset: 0x00037404
		protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
		{
			base.AutoGeneratedInstanceCollectObjects(collectedObjects);
			collectedObjects.Add(this._defaultPartyTemplate);
			collectedObjects.Add(this._minorFactionCharacterTemplates);
			collectedObjects.Add(this._kingdom);
			collectedObjects.Add(this._basicTroop);
			collectedObjects.Add(this._leader);
			collectedObjects.Add(this._banner);
			collectedObjects.Add(this._home);
			collectedObjects.Add(this.Name);
			collectedObjects.Add(this.InformalName);
			collectedObjects.Add(this.Culture);
			CampaignTime.AutoGeneratedStaticCollectObjectsCampaignTime(this.LastFactionChangeTime, collectedObjects);
			collectedObjects.Add(this.EncyclopediaText);
			CampaignTime.AutoGeneratedStaticCollectObjectsCampaignTime(this.NotAttackableByPlayerUntilTime, collectedObjects);
		}

		// Token: 0x06000985 RID: 2437 RVA: 0x000392BE File Offset: 0x000374BE
		internal static object AutoGeneratedGetMemberValueName(object o)
		{
			return ((Clan)o).Name;
		}

		// Token: 0x06000986 RID: 2438 RVA: 0x000392CB File Offset: 0x000374CB
		internal static object AutoGeneratedGetMemberValueInformalName(object o)
		{
			return ((Clan)o).InformalName;
		}

		// Token: 0x06000987 RID: 2439 RVA: 0x000392D8 File Offset: 0x000374D8
		internal static object AutoGeneratedGetMemberValueCulture(object o)
		{
			return ((Clan)o).Culture;
		}

		// Token: 0x06000988 RID: 2440 RVA: 0x000392E5 File Offset: 0x000374E5
		internal static object AutoGeneratedGetMemberValueLastFactionChangeTime(object o)
		{
			return ((Clan)o).LastFactionChangeTime;
		}

		// Token: 0x06000989 RID: 2441 RVA: 0x000392F7 File Offset: 0x000374F7
		internal static object AutoGeneratedGetMemberValueAutoRecruitmentExpenses(object o)
		{
			return ((Clan)o).AutoRecruitmentExpenses;
		}

		// Token: 0x0600098A RID: 2442 RVA: 0x00039309 File Offset: 0x00037509
		internal static object AutoGeneratedGetMemberValueEncyclopediaText(object o)
		{
			return ((Clan)o).EncyclopediaText;
		}

		// Token: 0x0600098B RID: 2443 RVA: 0x00039316 File Offset: 0x00037516
		internal static object AutoGeneratedGetMemberValueIsNoble(object o)
		{
			return ((Clan)o).IsNoble;
		}

		// Token: 0x0600098C RID: 2444 RVA: 0x00039328 File Offset: 0x00037528
		internal static object AutoGeneratedGetMemberValueMercenaryAwardMultiplier(object o)
		{
			return ((Clan)o).MercenaryAwardMultiplier;
		}

		// Token: 0x0600098D RID: 2445 RVA: 0x0003933A File Offset: 0x0003753A
		internal static object AutoGeneratedGetMemberValueLabelColor(object o)
		{
			return ((Clan)o).LabelColor;
		}

		// Token: 0x0600098E RID: 2446 RVA: 0x0003934C File Offset: 0x0003754C
		internal static object AutoGeneratedGetMemberValueInitialPosition(object o)
		{
			return ((Clan)o).InitialPosition;
		}

		// Token: 0x0600098F RID: 2447 RVA: 0x0003935E File Offset: 0x0003755E
		internal static object AutoGeneratedGetMemberValueIsRebelClan(object o)
		{
			return ((Clan)o).IsRebelClan;
		}

		// Token: 0x06000990 RID: 2448 RVA: 0x00039370 File Offset: 0x00037570
		internal static object AutoGeneratedGetMemberValueIsMinorFaction(object o)
		{
			return ((Clan)o).IsMinorFaction;
		}

		// Token: 0x06000991 RID: 2449 RVA: 0x00039382 File Offset: 0x00037582
		internal static object AutoGeneratedGetMemberValueIsOutlaw(object o)
		{
			return ((Clan)o).IsOutlaw;
		}

		// Token: 0x06000992 RID: 2450 RVA: 0x00039394 File Offset: 0x00037594
		internal static object AutoGeneratedGetMemberValueIsNomad(object o)
		{
			return ((Clan)o).IsNomad;
		}

		// Token: 0x06000993 RID: 2451 RVA: 0x000393A6 File Offset: 0x000375A6
		internal static object AutoGeneratedGetMemberValueIsMafia(object o)
		{
			return ((Clan)o).IsMafia;
		}

		// Token: 0x06000994 RID: 2452 RVA: 0x000393B8 File Offset: 0x000375B8
		internal static object AutoGeneratedGetMemberValueIsClanTypeMercenary(object o)
		{
			return ((Clan)o).IsClanTypeMercenary;
		}

		// Token: 0x06000995 RID: 2453 RVA: 0x000393CA File Offset: 0x000375CA
		internal static object AutoGeneratedGetMemberValueIsSect(object o)
		{
			return ((Clan)o).IsSect;
		}

		// Token: 0x06000996 RID: 2454 RVA: 0x000393DC File Offset: 0x000375DC
		internal static object AutoGeneratedGetMemberValueIsUnderMercenaryService(object o)
		{
			return ((Clan)o).IsUnderMercenaryService;
		}

		// Token: 0x06000997 RID: 2455 RVA: 0x000393EE File Offset: 0x000375EE
		internal static object AutoGeneratedGetMemberValueColor(object o)
		{
			return ((Clan)o).Color;
		}

		// Token: 0x06000998 RID: 2456 RVA: 0x00039400 File Offset: 0x00037600
		internal static object AutoGeneratedGetMemberValueColor2(object o)
		{
			return ((Clan)o).Color2;
		}

		// Token: 0x06000999 RID: 2457 RVA: 0x00039412 File Offset: 0x00037612
		internal static object AutoGeneratedGetMemberValueAlternativeColor(object o)
		{
			return ((Clan)o).AlternativeColor;
		}

		// Token: 0x0600099A RID: 2458 RVA: 0x00039424 File Offset: 0x00037624
		internal static object AutoGeneratedGetMemberValueAlternativeColor2(object o)
		{
			return ((Clan)o).AlternativeColor2;
		}

		// Token: 0x0600099B RID: 2459 RVA: 0x00039436 File Offset: 0x00037636
		internal static object AutoGeneratedGetMemberValueBannerBackgroundColorPrimary(object o)
		{
			return ((Clan)o).BannerBackgroundColorPrimary;
		}

		// Token: 0x0600099C RID: 2460 RVA: 0x00039448 File Offset: 0x00037648
		internal static object AutoGeneratedGetMemberValueBannerBackgroundColorSecondary(object o)
		{
			return ((Clan)o).BannerBackgroundColorSecondary;
		}

		// Token: 0x0600099D RID: 2461 RVA: 0x0003945A File Offset: 0x0003765A
		internal static object AutoGeneratedGetMemberValueBannerIconColor(object o)
		{
			return ((Clan)o).BannerIconColor;
		}

		// Token: 0x0600099E RID: 2462 RVA: 0x0003946C File Offset: 0x0003766C
		internal static object AutoGeneratedGetMemberValueIsBanditFaction(object o)
		{
			return ((Clan)o).IsBanditFaction;
		}

		// Token: 0x0600099F RID: 2463 RVA: 0x0003947E File Offset: 0x0003767E
		internal static object AutoGeneratedGetMemberValueRenown(object o)
		{
			return ((Clan)o).Renown;
		}

		// Token: 0x060009A0 RID: 2464 RVA: 0x00039490 File Offset: 0x00037690
		internal static object AutoGeneratedGetMemberValueMainHeroCrimeRating(object o)
		{
			return ((Clan)o).MainHeroCrimeRating;
		}

		// Token: 0x060009A1 RID: 2465 RVA: 0x000394A2 File Offset: 0x000376A2
		internal static object AutoGeneratedGetMemberValueNotAttackableByPlayerUntilTime(object o)
		{
			return ((Clan)o).NotAttackableByPlayerUntilTime;
		}

		// Token: 0x060009A2 RID: 2466 RVA: 0x000394B4 File Offset: 0x000376B4
		internal static object AutoGeneratedGetMemberValue_defaultPartyTemplate(object o)
		{
			return ((Clan)o)._defaultPartyTemplate;
		}

		// Token: 0x060009A3 RID: 2467 RVA: 0x000394C1 File Offset: 0x000376C1
		internal static object AutoGeneratedGetMemberValue_isEliminated(object o)
		{
			return ((Clan)o)._isEliminated;
		}

		// Token: 0x060009A4 RID: 2468 RVA: 0x000394D3 File Offset: 0x000376D3
		internal static object AutoGeneratedGetMemberValue_minorFactionCharacterTemplates(object o)
		{
			return ((Clan)o)._minorFactionCharacterTemplates;
		}

		// Token: 0x060009A5 RID: 2469 RVA: 0x000394E0 File Offset: 0x000376E0
		internal static object AutoGeneratedGetMemberValue_kingdom(object o)
		{
			return ((Clan)o)._kingdom;
		}

		// Token: 0x060009A6 RID: 2470 RVA: 0x000394ED File Offset: 0x000376ED
		internal static object AutoGeneratedGetMemberValue_influence(object o)
		{
			return ((Clan)o)._influence;
		}

		// Token: 0x060009A7 RID: 2471 RVA: 0x000394FF File Offset: 0x000376FF
		internal static object AutoGeneratedGetMemberValue_basicTroop(object o)
		{
			return ((Clan)o)._basicTroop;
		}

		// Token: 0x060009A8 RID: 2472 RVA: 0x0003950C File Offset: 0x0003770C
		internal static object AutoGeneratedGetMemberValue_leader(object o)
		{
			return ((Clan)o)._leader;
		}

		// Token: 0x060009A9 RID: 2473 RVA: 0x00039519 File Offset: 0x00037719
		internal static object AutoGeneratedGetMemberValue_banner(object o)
		{
			return ((Clan)o)._banner;
		}

		// Token: 0x060009AA RID: 2474 RVA: 0x00039526 File Offset: 0x00037726
		internal static object AutoGeneratedGetMemberValue_tier(object o)
		{
			return ((Clan)o)._tier;
		}

		// Token: 0x060009AB RID: 2475 RVA: 0x00039538 File Offset: 0x00037738
		internal static object AutoGeneratedGetMemberValue_aggressiveness(object o)
		{
			return ((Clan)o)._aggressiveness;
		}

		// Token: 0x060009AC RID: 2476 RVA: 0x0003954A File Offset: 0x0003774A
		internal static object AutoGeneratedGetMemberValue_tributeWallet(object o)
		{
			return ((Clan)o)._tributeWallet;
		}

		// Token: 0x060009AD RID: 2477 RVA: 0x0003955C File Offset: 0x0003775C
		internal static object AutoGeneratedGetMemberValue_home(object o)
		{
			return ((Clan)o)._home;
		}

		// Token: 0x060009AE RID: 2478 RVA: 0x00039569 File Offset: 0x00037769
		internal static object AutoGeneratedGetMemberValue_clanDebtToKingdom(object o)
		{
			return ((Clan)o)._clanDebtToKingdom;
		}

		// Token: 0x170001ED RID: 493
		// (get) Token: 0x060009AF RID: 2479 RVA: 0x0003957B File Offset: 0x0003777B
		// (set) Token: 0x060009B0 RID: 2480 RVA: 0x00039583 File Offset: 0x00037783
		[SaveableProperty(51)]
		public TextObject Name { get; private set; }

		// Token: 0x170001EE RID: 494
		// (get) Token: 0x060009B1 RID: 2481 RVA: 0x0003958C File Offset: 0x0003778C
		// (set) Token: 0x060009B2 RID: 2482 RVA: 0x00039594 File Offset: 0x00037794
		[SaveableProperty(52)]
		public TextObject InformalName { get; private set; }

		// Token: 0x170001EF RID: 495
		// (get) Token: 0x060009B3 RID: 2483 RVA: 0x0003959D File Offset: 0x0003779D
		// (set) Token: 0x060009B4 RID: 2484 RVA: 0x000395A5 File Offset: 0x000377A5
		[SaveableProperty(53)]
		public CultureObject Culture { get; set; }

		// Token: 0x170001F0 RID: 496
		// (get) Token: 0x060009B5 RID: 2485 RVA: 0x000395AE File Offset: 0x000377AE
		// (set) Token: 0x060009B6 RID: 2486 RVA: 0x000395B6 File Offset: 0x000377B6
		[SaveableProperty(55)]
		public CampaignTime LastFactionChangeTime { get; set; }

		// Token: 0x170001F1 RID: 497
		// (get) Token: 0x060009B7 RID: 2487 RVA: 0x000395BF File Offset: 0x000377BF
		public PartyTemplateObject DefaultPartyTemplate
		{
			get
			{
				if (this._defaultPartyTemplate != null)
				{
					return this._defaultPartyTemplate;
				}
				return this.Culture.DefaultPartyTemplate;
			}
		}

		// Token: 0x170001F2 RID: 498
		// (get) Token: 0x060009B8 RID: 2488 RVA: 0x000395DB File Offset: 0x000377DB
		// (set) Token: 0x060009B9 RID: 2489 RVA: 0x000395E3 File Offset: 0x000377E3
		[SaveableProperty(58)]
		public int AutoRecruitmentExpenses { get; set; }

		// Token: 0x170001F3 RID: 499
		// (get) Token: 0x060009BA RID: 2490 RVA: 0x000395EC File Offset: 0x000377EC
		// (set) Token: 0x060009BB RID: 2491 RVA: 0x000395F4 File Offset: 0x000377F4
		[SaveableProperty(56)]
		public TextObject EncyclopediaText { get; private set; }

		// Token: 0x170001F4 RID: 500
		// (get) Token: 0x060009BC RID: 2492 RVA: 0x000395FD File Offset: 0x000377FD
		// (set) Token: 0x060009BD RID: 2493 RVA: 0x00039605 File Offset: 0x00037805
		[SaveableProperty(140)]
		public bool IsNoble { get; set; }

		// Token: 0x170001F5 RID: 501
		// (get) Token: 0x060009BE RID: 2494 RVA: 0x0003960E File Offset: 0x0003780E
		public bool IsEliminated
		{
			get
			{
				return this._isEliminated;
			}
		}

		// Token: 0x170001F6 RID: 502
		// (get) Token: 0x060009BF RID: 2495 RVA: 0x00039616 File Offset: 0x00037816
		public IList<CharacterObject> MinorFactionCharacterTemplates
		{
			get
			{
				return this._minorFactionCharacterTemplates;
			}
		}

		// Token: 0x170001F7 RID: 503
		// (get) Token: 0x060009C0 RID: 2496 RVA: 0x0003961E File Offset: 0x0003781E
		public string EncyclopediaLink
		{
			get
			{
				return Campaign.Current.EncyclopediaManager.GetIdentifier(typeof(Clan)) + "-" + base.StringId;
			}
		}

		// Token: 0x170001F8 RID: 504
		// (get) Token: 0x060009C1 RID: 2497 RVA: 0x00039649 File Offset: 0x00037849
		public TextObject EncyclopediaLinkWithName
		{
			get
			{
				return HyperlinkTexts.GetClanHyperlinkText(this.EncyclopediaLink, this.Name);
			}
		}

		// Token: 0x170001F9 RID: 505
		// (get) Token: 0x060009C2 RID: 2498 RVA: 0x0003965C File Offset: 0x0003785C
		// (set) Token: 0x060009C3 RID: 2499 RVA: 0x00039664 File Offset: 0x00037864
		public Kingdom Kingdom
		{
			get
			{
				return this._kingdom;
			}
			set
			{
				if (this._kingdom != value)
				{
					this.SetKingdomInternal(value);
				}
			}
		}

		// Token: 0x170001FA RID: 506
		// (get) Token: 0x060009C4 RID: 2500 RVA: 0x00039676 File Offset: 0x00037876
		public IEnumerable<CharacterObject> DungeonPrisonersOfClan
		{
			get
			{
				foreach (Town town in this.Fiefs)
				{
					foreach (CharacterObject characterObject in town.Settlement.Party.PrisonerHeroes)
					{
						yield return characterObject;
					}
					IEnumerator<CharacterObject> enumerator2 = null;
				}
				List<Town>.Enumerator enumerator = default(List<Town>.Enumerator);
				yield break;
				yield break;
			}
		}

		// Token: 0x170001FB RID: 507
		// (get) Token: 0x060009C5 RID: 2501 RVA: 0x00039686 File Offset: 0x00037886
		public MBReadOnlyList<Town> Fiefs
		{
			get
			{
				return this._fiefsCache;
			}
		}

		// Token: 0x170001FC RID: 508
		// (get) Token: 0x060009C6 RID: 2502 RVA: 0x0003968E File Offset: 0x0003788E
		public MBReadOnlyList<Village> Villages
		{
			get
			{
				return this._villagesCache;
			}
		}

		// Token: 0x170001FD RID: 509
		// (get) Token: 0x060009C7 RID: 2503 RVA: 0x00039696 File Offset: 0x00037896
		public MBReadOnlyList<Settlement> Settlements
		{
			get
			{
				return this._settlementsCache;
			}
		}

		// Token: 0x170001FE RID: 510
		// (get) Token: 0x060009C8 RID: 2504 RVA: 0x0003969E File Offset: 0x0003789E
		public MBReadOnlyList<Hero> SupporterNotables
		{
			get
			{
				return this._supporterNotablesCache;
			}
		}

		// Token: 0x170001FF RID: 511
		// (get) Token: 0x060009C9 RID: 2505 RVA: 0x000396A6 File Offset: 0x000378A6
		public MBReadOnlyList<Hero> Lords
		{
			get
			{
				return this._lordsCache;
			}
		}

		// Token: 0x17000200 RID: 512
		// (get) Token: 0x060009CA RID: 2506 RVA: 0x000396AE File Offset: 0x000378AE
		public MBReadOnlyList<Hero> Heroes
		{
			get
			{
				return this._heroesCache;
			}
		}

		// Token: 0x17000201 RID: 513
		// (get) Token: 0x060009CB RID: 2507 RVA: 0x000396B6 File Offset: 0x000378B6
		public MBReadOnlyList<Hero> Companions
		{
			get
			{
				return this._companionsCache;
			}
		}

		// Token: 0x17000202 RID: 514
		// (get) Token: 0x060009CC RID: 2508 RVA: 0x000396BE File Offset: 0x000378BE
		public MBReadOnlyList<WarPartyComponent> WarPartyComponents
		{
			get
			{
				return this._warPartyComponentsCache;
			}
		}

		// Token: 0x17000203 RID: 515
		// (get) Token: 0x060009CD RID: 2509 RVA: 0x000396C6 File Offset: 0x000378C6
		// (set) Token: 0x060009CE RID: 2510 RVA: 0x000396CE File Offset: 0x000378CE
		public float Influence
		{
			get
			{
				return this._influence;
			}
			set
			{
				if (value < this._influence && this.Leader != null)
				{
					SkillLevelingManager.OnInfluenceSpent(this.Leader, value - this._influence);
				}
				this._influence = value;
			}
		}

		// Token: 0x17000204 RID: 516
		// (get) Token: 0x060009CF RID: 2511 RVA: 0x000396FB File Offset: 0x000378FB
		public ExplainedNumber InfluenceChangeExplained
		{
			get
			{
				return Campaign.Current.Models.ClanPoliticsModel.CalculateInfluenceChange(this, true);
			}
		}

		// Token: 0x17000205 RID: 517
		// (get) Token: 0x060009D0 RID: 2512 RVA: 0x00039713 File Offset: 0x00037913
		// (set) Token: 0x060009D1 RID: 2513 RVA: 0x0003971B File Offset: 0x0003791B
		[CachedData]
		public float TotalStrength { get; private set; }

		// Token: 0x17000206 RID: 518
		// (get) Token: 0x060009D2 RID: 2514 RVA: 0x00039724 File Offset: 0x00037924
		// (set) Token: 0x060009D3 RID: 2515 RVA: 0x0003972C File Offset: 0x0003792C
		[SaveableProperty(65)]
		public int MercenaryAwardMultiplier { get; set; }

		// Token: 0x17000207 RID: 519
		// (get) Token: 0x060009D4 RID: 2516 RVA: 0x00039735 File Offset: 0x00037935
		public bool IsMapFaction
		{
			get
			{
				return this._kingdom == null;
			}
		}

		// Token: 0x17000208 RID: 520
		// (get) Token: 0x060009D5 RID: 2517 RVA: 0x00039740 File Offset: 0x00037940
		// (set) Token: 0x060009D6 RID: 2518 RVA: 0x00039748 File Offset: 0x00037948
		[SaveableProperty(66)]
		public uint LabelColor { get; set; }

		// Token: 0x17000209 RID: 521
		// (get) Token: 0x060009D7 RID: 2519 RVA: 0x00039751 File Offset: 0x00037951
		// (set) Token: 0x060009D8 RID: 2520 RVA: 0x00039759 File Offset: 0x00037959
		[SaveableProperty(67)]
		public Vec2 InitialPosition { get; set; }

		// Token: 0x1700020A RID: 522
		// (get) Token: 0x060009D9 RID: 2521 RVA: 0x00039762 File Offset: 0x00037962
		// (set) Token: 0x060009DA RID: 2522 RVA: 0x0003976A File Offset: 0x0003796A
		[SaveableProperty(68)]
		public bool IsRebelClan { get; set; }

		// Token: 0x1700020B RID: 523
		// (get) Token: 0x060009DB RID: 2523 RVA: 0x00039773 File Offset: 0x00037973
		// (set) Token: 0x060009DC RID: 2524 RVA: 0x0003977B File Offset: 0x0003797B
		[SaveableProperty(69)]
		public bool IsMinorFaction { get; private set; }

		// Token: 0x1700020C RID: 524
		// (get) Token: 0x060009DD RID: 2525 RVA: 0x00039784 File Offset: 0x00037984
		// (set) Token: 0x060009DE RID: 2526 RVA: 0x0003978C File Offset: 0x0003798C
		[SaveableProperty(70)]
		public bool IsOutlaw { get; private set; }

		// Token: 0x1700020D RID: 525
		// (get) Token: 0x060009DF RID: 2527 RVA: 0x00039795 File Offset: 0x00037995
		// (set) Token: 0x060009E0 RID: 2528 RVA: 0x0003979D File Offset: 0x0003799D
		[SaveableProperty(71)]
		public bool IsNomad { get; private set; }

		// Token: 0x1700020E RID: 526
		// (get) Token: 0x060009E1 RID: 2529 RVA: 0x000397A6 File Offset: 0x000379A6
		// (set) Token: 0x060009E2 RID: 2530 RVA: 0x000397AE File Offset: 0x000379AE
		[SaveableProperty(72)]
		public bool IsMafia { get; private set; }

		// Token: 0x1700020F RID: 527
		// (get) Token: 0x060009E3 RID: 2531 RVA: 0x000397B7 File Offset: 0x000379B7
		// (set) Token: 0x060009E4 RID: 2532 RVA: 0x000397BF File Offset: 0x000379BF
		[SaveableProperty(73)]
		public bool IsClanTypeMercenary { get; private set; }

		// Token: 0x17000210 RID: 528
		// (get) Token: 0x060009E5 RID: 2533 RVA: 0x000397C8 File Offset: 0x000379C8
		// (set) Token: 0x060009E6 RID: 2534 RVA: 0x000397D0 File Offset: 0x000379D0
		[SaveableProperty(74)]
		public bool IsSect { get; private set; }

		// Token: 0x17000211 RID: 529
		// (get) Token: 0x060009E7 RID: 2535 RVA: 0x000397D9 File Offset: 0x000379D9
		// (set) Token: 0x060009E8 RID: 2536 RVA: 0x000397E1 File Offset: 0x000379E1
		[SaveableProperty(75)]
		public bool IsUnderMercenaryService { get; private set; }

		// Token: 0x17000212 RID: 530
		// (get) Token: 0x060009E9 RID: 2537 RVA: 0x000397EA File Offset: 0x000379EA
		// (set) Token: 0x060009EA RID: 2538 RVA: 0x000397F2 File Offset: 0x000379F2
		[SaveableProperty(76)]
		public uint Color { get; set; }

		// Token: 0x17000213 RID: 531
		// (get) Token: 0x060009EB RID: 2539 RVA: 0x000397FB File Offset: 0x000379FB
		// (set) Token: 0x060009EC RID: 2540 RVA: 0x00039803 File Offset: 0x00037A03
		[SaveableProperty(77)]
		public uint Color2 { get; set; }

		// Token: 0x17000214 RID: 532
		// (get) Token: 0x060009ED RID: 2541 RVA: 0x0003980C File Offset: 0x00037A0C
		// (set) Token: 0x060009EE RID: 2542 RVA: 0x00039814 File Offset: 0x00037A14
		[SaveableProperty(78)]
		public uint AlternativeColor { get; set; }

		// Token: 0x17000215 RID: 533
		// (get) Token: 0x060009EF RID: 2543 RVA: 0x0003981D File Offset: 0x00037A1D
		// (set) Token: 0x060009F0 RID: 2544 RVA: 0x00039825 File Offset: 0x00037A25
		[SaveableProperty(79)]
		public uint AlternativeColor2 { get; set; }

		// Token: 0x17000216 RID: 534
		// (get) Token: 0x060009F1 RID: 2545 RVA: 0x0003982E File Offset: 0x00037A2E
		// (set) Token: 0x060009F2 RID: 2546 RVA: 0x00039836 File Offset: 0x00037A36
		[SaveableProperty(111)]
		private uint BannerBackgroundColorPrimary { get; set; }

		// Token: 0x17000217 RID: 535
		// (get) Token: 0x060009F3 RID: 2547 RVA: 0x0003983F File Offset: 0x00037A3F
		// (set) Token: 0x060009F4 RID: 2548 RVA: 0x00039847 File Offset: 0x00037A47
		[SaveableProperty(112)]
		private uint BannerBackgroundColorSecondary { get; set; }

		// Token: 0x17000218 RID: 536
		// (get) Token: 0x060009F5 RID: 2549 RVA: 0x00039850 File Offset: 0x00037A50
		// (set) Token: 0x060009F6 RID: 2550 RVA: 0x00039858 File Offset: 0x00037A58
		[SaveableProperty(113)]
		private uint BannerIconColor { get; set; }

		// Token: 0x17000219 RID: 537
		// (get) Token: 0x060009F7 RID: 2551 RVA: 0x00039861 File Offset: 0x00037A61
		// (set) Token: 0x060009F8 RID: 2552 RVA: 0x00039869 File Offset: 0x00037A69
		[CachedData]
		private bool _midPointCalculated { get; set; }

		// Token: 0x1700021A RID: 538
		// (get) Token: 0x060009F9 RID: 2553 RVA: 0x00039872 File Offset: 0x00037A72
		// (set) Token: 0x060009FA RID: 2554 RVA: 0x00039889 File Offset: 0x00037A89
		public CharacterObject BasicTroop
		{
			get
			{
				return this._basicTroop ?? this.Culture.BasicTroop;
			}
			set
			{
				this._basicTroop = value;
			}
		}

		// Token: 0x1700021B RID: 539
		// (get) Token: 0x060009FB RID: 2555 RVA: 0x00039892 File Offset: 0x00037A92
		public static Clan PlayerClan
		{
			get
			{
				return Campaign.Current.PlayerDefaultFaction;
			}
		}

		// Token: 0x1700021C RID: 540
		// (get) Token: 0x060009FC RID: 2556 RVA: 0x0003989E File Offset: 0x00037A9E
		public Hero Leader
		{
			get
			{
				return this._leader;
			}
		}

		// Token: 0x1700021D RID: 541
		// (get) Token: 0x060009FD RID: 2557 RVA: 0x000398A6 File Offset: 0x00037AA6
		public int Gold
		{
			get
			{
				Hero leader = this.Leader;
				if (leader == null)
				{
					return 0;
				}
				return leader.Gold;
			}
		}

		// Token: 0x1700021E RID: 542
		// (get) Token: 0x060009FE RID: 2558 RVA: 0x000398B9 File Offset: 0x00037AB9
		// (set) Token: 0x060009FF RID: 2559 RVA: 0x000398E3 File Offset: 0x00037AE3
		public Banner Banner
		{
			get
			{
				if (this.Kingdom == null || this.Kingdom.RulingClan != this)
				{
					return this._banner;
				}
				return this.Kingdom.Banner;
			}
			private set
			{
				this._banner = value;
			}
		}

		// Token: 0x1700021F RID: 543
		// (get) Token: 0x06000A00 RID: 2560 RVA: 0x000398EC File Offset: 0x00037AEC
		// (set) Token: 0x06000A01 RID: 2561 RVA: 0x000398F4 File Offset: 0x00037AF4
		[SaveableProperty(85)]
		public bool IsBanditFaction { get; private set; }

		// Token: 0x17000220 RID: 544
		// (get) Token: 0x06000A02 RID: 2562 RVA: 0x000398FD File Offset: 0x00037AFD
		bool IFaction.IsKingdomFaction
		{
			get
			{
				return false;
			}
		}

		// Token: 0x17000221 RID: 545
		// (get) Token: 0x06000A03 RID: 2563 RVA: 0x00039900 File Offset: 0x00037B00
		public bool IsClan
		{
			get
			{
				return true;
			}
		}

		// Token: 0x17000222 RID: 546
		// (get) Token: 0x06000A04 RID: 2564 RVA: 0x00039903 File Offset: 0x00037B03
		// (set) Token: 0x06000A05 RID: 2565 RVA: 0x0003990B File Offset: 0x00037B0B
		[SaveableProperty(88)]
		public float Renown { get; set; }

		// Token: 0x17000223 RID: 547
		// (get) Token: 0x06000A06 RID: 2566 RVA: 0x00039914 File Offset: 0x00037B14
		// (set) Token: 0x06000A07 RID: 2567 RVA: 0x0003991C File Offset: 0x00037B1C
		[SaveableProperty(89)]
		public float MainHeroCrimeRating { get; set; }

		// Token: 0x17000224 RID: 548
		// (get) Token: 0x06000A08 RID: 2568 RVA: 0x00039928 File Offset: 0x00037B28
		public float DailyCrimeRatingChange
		{
			get
			{
				return Campaign.Current.Models.CrimeModel.GetDailyCrimeRatingChange(this, false).ResultNumber;
			}
		}

		// Token: 0x17000225 RID: 549
		// (get) Token: 0x06000A09 RID: 2569 RVA: 0x00039953 File Offset: 0x00037B53
		public ExplainedNumber DailyCrimeRatingChangeExplained
		{
			get
			{
				return Campaign.Current.Models.CrimeModel.GetDailyCrimeRatingChange(this, true);
			}
		}

		// Token: 0x17000226 RID: 550
		// (get) Token: 0x06000A0A RID: 2570 RVA: 0x0003996B File Offset: 0x00037B6B
		// (set) Token: 0x06000A0B RID: 2571 RVA: 0x00039974 File Offset: 0x00037B74
		public int Tier
		{
			get
			{
				return this._tier;
			}
			private set
			{
				int minClanTier = Campaign.Current.Models.ClanTierModel.MinClanTier;
				int maxClanTier = Campaign.Current.Models.ClanTierModel.MaxClanTier;
				if (value > maxClanTier)
				{
					value = maxClanTier;
				}
				else if (value < minClanTier)
				{
					value = minClanTier;
				}
				this._tier = value;
			}
		}

		// Token: 0x17000227 RID: 551
		// (get) Token: 0x06000A0C RID: 2572 RVA: 0x000399C2 File Offset: 0x00037BC2
		public IFaction MapFaction
		{
			get
			{
				if (this.Kingdom != null)
				{
					return this.Kingdom;
				}
				return this;
			}
		}

		// Token: 0x17000228 RID: 552
		// (get) Token: 0x06000A0D RID: 2573 RVA: 0x000399D4 File Offset: 0x00037BD4
		// (set) Token: 0x06000A0E RID: 2574 RVA: 0x000399DC File Offset: 0x00037BDC
		[SaveableProperty(100)]
		public CampaignTime NotAttackableByPlayerUntilTime { get; set; }

		// Token: 0x17000229 RID: 553
		// (get) Token: 0x06000A0F RID: 2575 RVA: 0x000399E5 File Offset: 0x00037BE5
		// (set) Token: 0x06000A10 RID: 2576 RVA: 0x000399ED File Offset: 0x00037BED
		public float Aggressiveness
		{
			get
			{
				return this._aggressiveness;
			}
			internal set
			{
				this._aggressiveness = MathF.Clamp(value, 0f, 100f);
			}
		}

		// Token: 0x1700022A RID: 554
		// (get) Token: 0x06000A11 RID: 2577 RVA: 0x00039A05 File Offset: 0x00037C05
		// (set) Token: 0x06000A12 RID: 2578 RVA: 0x00039A0D File Offset: 0x00037C0D
		public int TributeWallet
		{
			get
			{
				return this._tributeWallet;
			}
			set
			{
				this._tributeWallet = value;
			}
		}

		// Token: 0x1700022B RID: 555
		// (get) Token: 0x06000A13 RID: 2579 RVA: 0x00039A16 File Offset: 0x00037C16
		// (set) Token: 0x06000A14 RID: 2580 RVA: 0x00039A1E File Offset: 0x00037C1E
		public Settlement HomeSettlement
		{
			get
			{
				return this._home;
			}
			private set
			{
				this._home = value;
			}
		}

		// Token: 0x1700022C RID: 556
		// (get) Token: 0x06000A15 RID: 2581 RVA: 0x00039A29 File Offset: 0x00037C29
		// (set) Token: 0x06000A16 RID: 2582 RVA: 0x00039A31 File Offset: 0x00037C31
		public int DebtToKingdom
		{
			get
			{
				return this._clanDebtToKingdom;
			}
			set
			{
				this._clanDebtToKingdom = value;
			}
		}

		// Token: 0x06000A17 RID: 2583 RVA: 0x00039A3C File Offset: 0x00037C3C
		public void UpdateStrength()
		{
			this.TotalStrength = 0f;
			foreach (WarPartyComponent warPartyComponent in this._warPartyComponentsCache)
			{
				this.TotalStrength += warPartyComponent.MobileParty.Party.TotalStrength;
			}
			foreach (Town town in this.Fiefs)
			{
				if (town.GarrisonParty != null)
				{
					this.TotalStrength += town.GarrisonParty.Party.TotalStrength;
				}
			}
		}

		// Token: 0x1700022D RID: 557
		// (get) Token: 0x06000A18 RID: 2584 RVA: 0x00039B10 File Offset: 0x00037D10
		public IEnumerable<StanceLink> Stances
		{
			get
			{
				return this._stances;
			}
		}

		// Token: 0x1700022E RID: 558
		// (get) Token: 0x06000A19 RID: 2585 RVA: 0x00039B18 File Offset: 0x00037D18
		public int RenownRequirementForNextTier
		{
			get
			{
				return Campaign.Current.Models.ClanTierModel.GetRequiredRenownForTier(this.Tier + 1);
			}
		}

		// Token: 0x1700022F RID: 559
		// (get) Token: 0x06000A1A RID: 2586 RVA: 0x00039B36 File Offset: 0x00037D36
		public int CompanionLimit
		{
			get
			{
				return Campaign.Current.Models.ClanTierModel.GetCompanionLimit(this);
			}
		}

		// Token: 0x17000230 RID: 560
		// (get) Token: 0x06000A1B RID: 2587 RVA: 0x00039B4D File Offset: 0x00037D4D
		public float DistanceToClosestNonAllyFortification
		{
			get
			{
				if (this._distanceToClosestNonAllyFortificationCacheDirty)
				{
					this._distanceToClosestNonAllyFortificationCache = FactionHelper.GetDistanceToClosestNonAllyFortificationOfFaction(this);
					this._distanceToClosestNonAllyFortificationCacheDirty = false;
				}
				return this._distanceToClosestNonAllyFortificationCache;
			}
		}

		// Token: 0x17000231 RID: 561
		// (get) Token: 0x06000A1C RID: 2588 RVA: 0x00039B70 File Offset: 0x00037D70
		public int CommanderLimit
		{
			get
			{
				return Campaign.Current.Models.ClanTierModel.GetPartyLimitForTier(this, this.Tier);
			}
		}

		// Token: 0x06000A1D RID: 2589 RVA: 0x00039B8D File Offset: 0x00037D8D
		public bool IsAtWarWith(IFaction other)
		{
			return FactionManager.IsAtWarAgainstFaction(this, other);
		}

		// Token: 0x06000A1E RID: 2590 RVA: 0x00039B96 File Offset: 0x00037D96
		private void UpdateFactionMidSettlement()
		{
			this._clanMidSettlement = FactionHelper.FactionMidSettlement(this);
			this._midPointCalculated = (this._clanMidSettlement != null);
		}

		// Token: 0x17000232 RID: 562
		// (get) Token: 0x06000A1F RID: 2591 RVA: 0x00039BB3 File Offset: 0x00037DB3
		public Settlement FactionMidSettlement
		{
			get
			{
				if (!this._midPointCalculated)
				{
					this.UpdateFactionMidSettlement();
				}
				return this._clanMidSettlement;
			}
		}

		// Token: 0x06000A20 RID: 2592 RVA: 0x00039BCC File Offset: 0x00037DCC
		private void InitMembers()
		{
			this._companionsCache = new MBList<Hero>();
			this._warPartyComponentsCache = new MBList<WarPartyComponent>();
			this._stances = new List<StanceLink>();
			this._supporterNotablesCache = new MBList<Hero>();
			this._lordsCache = new MBList<Hero>();
			this._heroesCache = new MBList<Hero>();
			this._villagesCache = new MBList<Village>();
			this._fiefsCache = new MBList<Town>();
			this._settlementsCache = new MBList<Settlement>();
		}

		// Token: 0x06000A21 RID: 2593 RVA: 0x00039C3C File Offset: 0x00037E3C
		public Clan()
		{
			this.InitMembers();
			this._isEliminated = false;
			this.NotAttackableByPlayerUntilTime = CampaignTime.Zero;
		}

		// Token: 0x06000A22 RID: 2594 RVA: 0x00039C64 File Offset: 0x00037E64
		public static Clan CreateClan(string stringID)
		{
			stringID = Campaign.Current.CampaignObjectManager.FindNextUniqueStringId<Clan>(stringID);
			Clan clan = new Clan();
			clan.StringId = stringID;
			Campaign.Current.CampaignObjectManager.AddClan(clan);
			return clan;
		}

		// Token: 0x06000A23 RID: 2595 RVA: 0x00039CA1 File Offset: 0x00037EA1
		public void InitializeClan(TextObject name, TextObject informalName, CultureObject culture, Banner banner, Vec2 initialPosition = default(Vec2), bool isDeserialize = false)
		{
			this.ChangeClanName(name, informalName);
			this.Culture = culture;
			this.Banner = banner;
			if (!isDeserialize)
			{
				this.ValidateInitialPosition(initialPosition);
			}
		}

		// Token: 0x06000A24 RID: 2596 RVA: 0x00039CC8 File Offset: 0x00037EC8
		protected override void PreAfterLoad()
		{
			if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion < ApplicationVersion.FromString("v1.2.2", 54620) && base.StringId == "neutral")
			{
				foreach (Hero hero in Campaign.Current.AliveHeroes)
				{
					if (hero.Clan == this)
					{
						hero.ResetClanForOldSave();
						if (this._lordsCache.Contains(hero))
						{
							this._lordsCache.Remove(hero);
						}
						if (this._heroesCache.Contains(hero))
						{
							this._heroesCache.Remove(hero);
						}
					}
				}
				foreach (Hero hero2 in Campaign.Current.DeadOrDisabledHeroes)
				{
					if (hero2.Clan == this)
					{
						hero2.ResetClanForOldSave();
						if (this._lordsCache.Contains(hero2))
						{
							this._lordsCache.Remove(hero2);
						}
						if (this._heroesCache.Contains(hero2))
						{
							this._heroesCache.Remove(hero2);
						}
					}
				}
				for (int i = this.Heroes.Count - 1; i >= 0; i--)
				{
					Hero hero3 = this.Heroes[i];
					hero3.ResetClanForOldSave();
					if (this._lordsCache.Contains(hero3))
					{
						this._lordsCache.Remove(hero3);
					}
					if (this._heroesCache.Contains(hero3))
					{
						this._heroesCache.Remove(hero3);
					}
				}
				DestroyClanAction.Apply(this);
				Campaign.Current.CampaignObjectManager.RemoveClan(this);
			}
			if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion < ApplicationVersion.FromString("e1.8.0.0", 54620))
			{
				Hero leader = this.Leader;
				this.IsNoble = (leader != null && leader.IsNobleForOldSaves);
			}
			Kingdom kingdom = this._kingdom;
			if (kingdom != null)
			{
				kingdom.AddClanInternal(this);
			}
			this._midPointCalculated = (this._clanMidSettlement != null);
			if (this.HomeSettlement == null && !this.IsBanditFaction)
			{
				this.UpdateHomeSettlement(null);
			}
			this.ValidateInitialPosition(this.InitialPosition);
			this.UpdateBannerColorsAccordingToKingdom();
		}

		// Token: 0x06000A25 RID: 2597 RVA: 0x00039F20 File Offset: 0x00038120
		protected override void AfterLoad()
		{
			this.UpdateStrength();
			if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion < ApplicationVersion.FromString("e1.8.0.0", 54620) && this.Kingdom != null)
			{
				FactionHelper.AdjustFactionStancesForClanJoiningKingdom(this, this.Kingdom);
			}
			if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion < ApplicationVersion.FromString("v1.1.3", 54620) && this.Kingdom == null && this.IsUnderMercenaryService)
			{
				this.EndMercenaryService(true);
			}
			if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion < ApplicationVersion.FromString("v1.2.0", 54620) && this.IsEliminated && this.Leader != null && this.Leader.IsAlive)
			{
				DestroyClanAction.Apply(this);
			}
		}

		// Token: 0x06000A26 RID: 2598 RVA: 0x00039FE8 File Offset: 0x000381E8
		public override void Deserialize(MBObjectManager objectManager, XmlNode node)
		{
			base.Deserialize(objectManager, node);
			this.SetLeader(objectManager.ReadObjectReferenceFromXml("owner", typeof(Hero), node) as Hero);
			this.Kingdom = (Kingdom)objectManager.ReadObjectReferenceFromXml("super_faction", typeof(Kingdom), node);
			this.Tier = ((node.Attributes["tier"] == null) ? 1 : Convert.ToInt32(node.Attributes["tier"].Value));
			this.Renown = (float)Campaign.Current.Models.ClanTierModel.CalculateInitialRenown(this);
			this.InitializeClan(new TextObject(node.Attributes["name"].Value, null), (node.Attributes["short_name"] != null) ? new TextObject(node.Attributes["short_name"].Value, null) : new TextObject(node.Attributes["name"].Value, null), (CultureObject)objectManager.ReadObjectReferenceFromXml("culture", typeof(CultureObject), node), null, default(Vec2), true);
			XmlNode xmlNode = node.Attributes["is_noble"];
			if (xmlNode != null)
			{
				this.IsNoble = Convert.ToBoolean(xmlNode.InnerText);
			}
			this.LabelColor = ((node.Attributes["label_color"] == null) ? 0U : Convert.ToUInt32(node.Attributes["label_color"].Value, 16));
			this.Color = ((node.Attributes["color"] == null) ? 4291609515U : Convert.ToUInt32(node.Attributes["color"].Value, 16));
			this.Color2 = ((node.Attributes["color2"] == null) ? 4291609515U : Convert.ToUInt32(node.Attributes["color2"].Value, 16));
			this.AlternativeColor = ((node.Attributes["alternative_color"] == null) ? 4291609515U : Convert.ToUInt32(node.Attributes["alternative_color"].Value, 16));
			this.AlternativeColor2 = ((node.Attributes["alternative_color2"] == null) ? 4291609515U : Convert.ToUInt32(node.Attributes["alternative_color2"].Value, 16));
			if (node.Attributes["initial_posX"] != null && node.Attributes["initial_posY"] != null)
			{
				this.InitialPosition = new Vec2((float)Convert.ToDouble(node.Attributes["initial_posX"].Value), (float)Convert.ToDouble(node.Attributes["initial_posY"].Value));
			}
			this.IsBanditFaction = (node.Attributes["is_bandit"] != null && Convert.ToBoolean(node.Attributes["is_bandit"].Value));
			this.IsMinorFaction = (node.Attributes["is_minor_faction"] != null && Convert.ToBoolean(node.Attributes["is_minor_faction"].Value));
			this.IsOutlaw = (node.Attributes["is_outlaw"] != null && Convert.ToBoolean(node.Attributes["is_outlaw"].Value));
			this.IsSect = (node.Attributes["is_sect"] != null && Convert.ToBoolean(node.Attributes["is_sect"].Value));
			this.IsMafia = (node.Attributes["is_mafia"] != null && Convert.ToBoolean(node.Attributes["is_mafia"].Value));
			this.IsClanTypeMercenary = (node.Attributes["is_clan_type_mercenary"] != null && Convert.ToBoolean(node.Attributes["is_clan_type_mercenary"].Value));
			this.IsNomad = (node.Attributes["is_nomad"] != null && Convert.ToBoolean(node.Attributes["is_nomad"].Value));
			this._defaultPartyTemplate = (PartyTemplateObject)objectManager.ReadObjectReferenceFromXml("default_party_template", typeof(PartyTemplateObject), node);
			this.EncyclopediaText = ((node.Attributes["text"] != null) ? new TextObject(node.Attributes["text"].Value, null) : TextObject.Empty);
			if (node.Attributes["banner_key"] != null)
			{
				this._banner = new Banner();
				this._banner.Deserialize(node.Attributes["banner_key"].Value);
			}
			else
			{
				this._banner = Banner.CreateRandomClanBanner(base.StringId.GetDeterministicHashCode());
			}
			this.BannerBackgroundColorPrimary = this._banner.GetPrimaryColor();
			this.BannerBackgroundColorSecondary = this._banner.GetSecondaryColor();
			this.BannerIconColor = this._banner.GetFirstIconColor();
			this.UpdateBannerColorsAccordingToKingdom();
			this._minorFactionCharacterTemplates = new MBList<CharacterObject>();
			foreach (object obj in node.ChildNodes)
			{
				XmlNode xmlNode2 = (XmlNode)obj;
				if (xmlNode2.Name == "minor_faction_character_templates")
				{
					using (IEnumerator enumerator2 = xmlNode2.ChildNodes.GetEnumerator())
					{
						while (enumerator2.MoveNext())
						{
							object obj2 = enumerator2.Current;
							XmlNode node2 = (XmlNode)obj2;
							CharacterObject item = objectManager.ReadObjectReferenceFromXml("id", typeof(CharacterObject), node2) as CharacterObject;
							this._minorFactionCharacterTemplates.Add(item);
						}
						continue;
					}
				}
				if (xmlNode2.Name == "relationship")
				{
					IFaction faction;
					if (xmlNode2.Attributes["clan"] != null)
					{
						faction = (Clan)objectManager.ReadObjectReferenceFromXml("clan", typeof(Clan), xmlNode2);
					}
					else
					{
						faction = (Kingdom)objectManager.ReadObjectReferenceFromXml("kingdom", typeof(Kingdom), xmlNode2);
					}
					int num = Convert.ToInt32(xmlNode2.Attributes["value"].InnerText);
					if (num > 0)
					{
						FactionManager.DeclareAlliance(this, faction);
					}
					else if (num < 0)
					{
						FactionManager.DeclareWar(this, faction, false);
					}
					else
					{
						FactionManager.SetNeutral(this, faction);
					}
				}
			}
		}

		// Token: 0x06000A27 RID: 2599 RVA: 0x0003A6CC File Offset: 0x000388CC
		protected override void OnBeforeLoad()
		{
		}

		// Token: 0x06000A28 RID: 2600 RVA: 0x0003A6CE File Offset: 0x000388CE
		[LoadInitializationCallback]
		private void OnLoad(MetaData metaData)
		{
			this.InitMembers();
		}

		// Token: 0x06000A29 RID: 2601 RVA: 0x0003A6D6 File Offset: 0x000388D6
		public void OnGameCreated()
		{
			this.ValidateInitialPosition(this.InitialPosition);
		}

		// Token: 0x06000A2A RID: 2602 RVA: 0x0003A6E4 File Offset: 0x000388E4
		public int GetRelationWithClan(Clan other)
		{
			if (this.Leader != null && other.Leader != null)
			{
				return this.Leader.GetRelation(other.Leader);
			}
			return 0;
		}

		// Token: 0x06000A2B RID: 2603 RVA: 0x0003A709 File Offset: 0x00038909
		public void SetLeader(Hero leader)
		{
			this._leader = leader;
			if (leader != null)
			{
				leader.Clan = this;
			}
		}

		// Token: 0x06000A2C RID: 2604 RVA: 0x0003A71C File Offset: 0x0003891C
		private float FindSettlementScoreForBeingHomeSettlement(Settlement settlement)
		{
			int num = (int)settlement.Town.Prosperity;
			foreach (Village village in settlement.BoundVillages)
			{
				num += (int)village.Hearth;
			}
			float num2 = settlement.IsTown ? 1f : 0.5f;
			float num3 = MathF.Sqrt(1000f + (float)num) / 50f;
			float num4 = (this.HomeSettlement == settlement) ? 1f : 0.65f;
			float num5 = (settlement.Culture == this.Culture) ? 1f : 0.25f;
			float num6 = (settlement.OwnerClan.Culture == this.Culture) ? 1f : 0.85f;
			float num7 = (settlement.OwnerClan == this) ? 1f : 0.1f;
			float num8 = (settlement.MapFaction == this.MapFaction) ? 1f : 0.1f;
			float num9;
			if (this.MapFaction.FactionMidSettlement != null)
			{
				num9 = Campaign.Current.Models.MapDistanceModel.GetDistance(this.MapFaction.FactionMidSettlement, settlement);
			}
			else
			{
				num9 = this.InitialPosition.Distance(settlement.GatePosition);
			}
			float num10 = 1f - num9 / Campaign.MaximumDistanceBetweenTwoSettlements;
			num10 *= num10;
			return num2 * num3 * num5 * num6 * num8 * num7 * num10 * num4;
		}

		// Token: 0x06000A2D RID: 2605 RVA: 0x0003A8A8 File Offset: 0x00038AA8
		public void UpdateHomeSettlement(Settlement updatedSettlement)
		{
			Settlement settlement = this.HomeSettlement;
			if (this.HomeSettlement == null || updatedSettlement == null || (this.HomeSettlement == updatedSettlement && updatedSettlement.OwnerClan != this))
			{
				float num = 0f;
				foreach (Settlement settlement2 in Settlement.All)
				{
					if (settlement2.IsFortification)
					{
						float num2 = this.FindSettlementScoreForBeingHomeSettlement(settlement2);
						if (num2 > num)
						{
							settlement = settlement2;
							num = num2;
						}
					}
				}
			}
			if (settlement != this.HomeSettlement)
			{
				this.HomeSettlement = settlement;
				foreach (Hero hero in this.Heroes)
				{
					hero.UpdateHomeSettlement();
				}
			}
		}

		// Token: 0x06000A2E RID: 2606 RVA: 0x0003A988 File Offset: 0x00038B88
		private void ValidateInitialPosition(Vec2 initialPosition)
		{
			if (initialPosition.IsValid && this.InitialPosition.IsNonZero())
			{
				this.InitialPosition = initialPosition;
				return;
			}
			Vec2 centerPosition;
			if (this.Settlements.Count > 0)
			{
				centerPosition = this.Settlements.GetRandomElement<Settlement>().GatePosition;
			}
			else
			{
				Settlement randomElementWithPredicate = Settlement.All.GetRandomElementWithPredicate((Settlement x) => x.Culture == this.Culture);
				centerPosition = ((randomElementWithPredicate != null) ? randomElementWithPredicate.GatePosition : Settlement.All.GetRandomElement<Settlement>().GatePosition);
			}
			this.InitialPosition = MobilePartyHelper.FindReachablePointAroundPosition(centerPosition, 150f, 0f);
		}

		// Token: 0x06000A2F RID: 2607 RVA: 0x0003AA1E File Offset: 0x00038C1E
		public override TextObject GetName()
		{
			return this.Name;
		}

		// Token: 0x06000A30 RID: 2608 RVA: 0x0003AA26 File Offset: 0x00038C26
		public void ChangeClanName(TextObject name, TextObject informalName)
		{
			this.Name = name;
			this.InformalName = informalName;
		}

		// Token: 0x06000A31 RID: 2609 RVA: 0x0003AA36 File Offset: 0x00038C36
		public override string ToString()
		{
			return string.Concat(new object[]
			{
				"(",
				base.Id,
				") ",
				this.Name
			});
		}

		// Token: 0x06000A32 RID: 2610 RVA: 0x0003AA6A File Offset: 0x00038C6A
		public StanceLink GetStanceWith(IFaction other)
		{
			return FactionManager.Instance.GetStanceLinkInternal(this, other);
		}

		// Token: 0x06000A33 RID: 2611 RVA: 0x0003AA78 File Offset: 0x00038C78
		internal void AddStanceInternal(StanceLink stanceLink)
		{
			this._stances.Add(stanceLink);
		}

		// Token: 0x06000A34 RID: 2612 RVA: 0x0003AA86 File Offset: 0x00038C86
		internal void RemoveStanceInternal(StanceLink stanceLink)
		{
			this._stances.Remove(stanceLink);
		}

		// Token: 0x06000A35 RID: 2613 RVA: 0x0003AA95 File Offset: 0x00038C95
		private void SetKingdomInternal(Kingdom value)
		{
			if (this.Kingdom != null)
			{
				this.LeaveKingdomInternal();
			}
			this._kingdom = value;
			if (this.Kingdom != null)
			{
				this.EnterKingdomInternal();
			}
			this.UpdateBannerColorsAccordingToKingdom();
			this.LastFactionChangeTime = CampaignTime.Now;
		}

		// Token: 0x06000A36 RID: 2614 RVA: 0x0003AACC File Offset: 0x00038CCC
		private void EnterKingdomInternal()
		{
			this._kingdom.AddClanInternal(this);
			foreach (Hero hero in this.Heroes)
			{
				this._kingdom.OnHeroAdded(hero);
			}
			foreach (Town fief in this.Fiefs)
			{
				this._kingdom.OnFortificationAdded(fief);
			}
			foreach (WarPartyComponent warPartyComponent in this.WarPartyComponents)
			{
				this._kingdom.OnWarPartyAdded(warPartyComponent);
			}
		}

		// Token: 0x06000A37 RID: 2615 RVA: 0x0003ABC4 File Offset: 0x00038DC4
		private void LeaveKingdomInternal()
		{
			ChangeClanInfluenceAction.Apply(this, -this.Influence);
			this._kingdom.RemoveClanInternal(this);
			foreach (Hero hero in this.Heroes)
			{
				this._kingdom.OnHeroRemoved(hero);
			}
			foreach (Town fief in this.Fiefs)
			{
				this._kingdom.OnFiefRemoved(fief);
			}
			List<WarPartyComponent> list = this.WarPartyComponents.ToListQ<WarPartyComponent>();
			for (int i = list.Count<WarPartyComponent>() - 1; i >= 0; i--)
			{
				if (list[i].MobileParty.Army != null)
				{
					list[i].MobileParty.Army = null;
				}
				this._kingdom.OnWarPartyRemoved(list[i]);
			}
		}

		// Token: 0x06000A38 RID: 2616 RVA: 0x0003ACDC File Offset: 0x00038EDC
		public void ClanLeaveKingdom(bool giveBackFiefs = false)
		{
			ChangeClanInfluenceAction.Apply(this, -this.Influence);
			if (this.Kingdom != null)
			{
				foreach (Settlement settlement in Campaign.Current.Settlements)
				{
					if (settlement.IsTown && settlement.OwnerClan == this)
					{
						SettlementHelper.TakeEnemyVillagersOutsideSettlements(settlement);
					}
				}
			}
			this.LastFactionChangeTime = CampaignTime.Now;
			this.Kingdom = null;
		}

		// Token: 0x06000A39 RID: 2617 RVA: 0x0003AD6C File Offset: 0x00038F6C
		public float CalculateTotalSettlementBaseValue()
		{
			float num = 0f;
			foreach (Town town in this.Fiefs)
			{
				num += Campaign.Current.Models.SettlementValueModel.CalculateSettlementBaseValue(town.Owner.Settlement);
			}
			return num;
		}

		// Token: 0x06000A3A RID: 2618 RVA: 0x0003ADE4 File Offset: 0x00038FE4
		public void StartMercenaryService()
		{
			this.IsUnderMercenaryService = true;
		}

		// Token: 0x06000A3B RID: 2619 RVA: 0x0003ADF0 File Offset: 0x00038FF0
		private int DistanceOfTwoValues(int x, int y)
		{
			int num = (x < 50) ? x : (100 - x);
			int num2 = (y < 50) ? y : (100 - y);
			return MathF.Min(num + num2, x - y);
		}

		// Token: 0x06000A3C RID: 2620 RVA: 0x0003AE20 File Offset: 0x00039020
		public static Clan FindFirst(Predicate<Clan> predicate)
		{
			return Clan.All.FirstOrDefault((Clan x) => predicate(x));
		}

		// Token: 0x06000A3D RID: 2621 RVA: 0x0003AE50 File Offset: 0x00039050
		public void EndMercenaryService(bool isByLeavingKingdom)
		{
			this.IsUnderMercenaryService = false;
		}

		// Token: 0x06000A3E RID: 2622 RVA: 0x0003AE5C File Offset: 0x0003905C
		public static IEnumerable<Clan> FindAll(Predicate<Clan> predicate)
		{
			return from x in Clan.All
			where predicate(x)
			select x;
		}

		// Token: 0x17000233 RID: 563
		// (get) Token: 0x06000A3F RID: 2623 RVA: 0x0003AE8C File Offset: 0x0003908C
		public static MBReadOnlyList<Clan> All
		{
			get
			{
				return Campaign.Current.Clans;
			}
		}

		// Token: 0x17000234 RID: 564
		// (get) Token: 0x06000A40 RID: 2624 RVA: 0x0003AE98 File Offset: 0x00039098
		public static IEnumerable<Clan> NonBanditFactions
		{
			get
			{
				foreach (Clan clan in Campaign.Current.Clans)
				{
					if (!clan.IsBanditFaction)
					{
						yield return clan;
					}
				}
				List<Clan>.Enumerator enumerator = default(List<Clan>.Enumerator);
				yield break;
				yield break;
			}
		}

		// Token: 0x06000A41 RID: 2625 RVA: 0x0003AEA4 File Offset: 0x000390A4
		public float CalculateTotalSettlementValueForFaction(Kingdom kingdom)
		{
			float num = 0f;
			foreach (Town town in this.Fiefs)
			{
				num += Campaign.Current.Models.SettlementValueModel.CalculateSettlementValueForFaction(town.Owner.Settlement, kingdom);
			}
			return num;
		}

		// Token: 0x17000235 RID: 565
		// (get) Token: 0x06000A42 RID: 2626 RVA: 0x0003AF1C File Offset: 0x0003911C
		public static IEnumerable<Clan> BanditFactions
		{
			get
			{
				foreach (Clan clan in Campaign.Current.Clans)
				{
					if (clan.IsBanditFaction)
					{
						yield return clan;
					}
				}
				List<Clan>.Enumerator enumerator = default(List<Clan>.Enumerator);
				yield break;
				yield break;
			}
		}

		// Token: 0x06000A43 RID: 2627 RVA: 0x0003AF28 File Offset: 0x00039128
		internal void OnFortificationAdded(Town settlement)
		{
			this._fiefsCache.Add(settlement);
			this._settlementsCache.Add(settlement.Settlement);
			foreach (Village village in settlement.Settlement.BoundVillages)
			{
				this.OnBoundVillageAddedInternal(village);
			}
			this._midPointCalculated = false;
			this._distanceToClosestNonAllyFortificationCacheDirty = true;
			if (this._kingdom != null)
			{
				this._kingdom._midPointCalculated = false;
				this._kingdom._distanceToClosestNonAllyFortificationCacheDirty = true;
				this._kingdom.OnFortificationAdded(settlement);
			}
		}

		// Token: 0x06000A44 RID: 2628 RVA: 0x0003AFD8 File Offset: 0x000391D8
		internal void OnFortificationRemoved(Town settlement)
		{
			this._fiefsCache.Remove(settlement);
			this._settlementsCache.Remove(settlement.Settlement);
			foreach (Village village in settlement.Settlement.BoundVillages)
			{
				this._villagesCache.Remove(village);
				this._settlementsCache.Remove(village.Settlement);
			}
			this._midPointCalculated = false;
			this._distanceToClosestNonAllyFortificationCacheDirty = true;
			if (this._kingdom != null)
			{
				this._kingdom._midPointCalculated = false;
				this._kingdom._distanceToClosestNonAllyFortificationCacheDirty = true;
				this._kingdom.OnFiefRemoved(settlement);
			}
		}

		// Token: 0x06000A45 RID: 2629 RVA: 0x0003B0A4 File Offset: 0x000392A4
		public void OnBoundVillageAdded(Village village)
		{
			this.OnBoundVillageAddedInternal(village);
			if (this._kingdom != null)
			{
				this._kingdom.OnBoundVillageAdded(village);
			}
		}

		// Token: 0x06000A46 RID: 2630 RVA: 0x0003B0C1 File Offset: 0x000392C1
		private void OnBoundVillageAddedInternal(Village village)
		{
			this._villagesCache.Add(village);
			this._settlementsCache.Add(village.Settlement);
		}

		// Token: 0x06000A47 RID: 2631 RVA: 0x0003B0E0 File Offset: 0x000392E0
		internal void OnLordAdded(Hero lord)
		{
			this._lordsCache.Add(lord);
			this.OnHeroAdded(lord);
		}

		// Token: 0x06000A48 RID: 2632 RVA: 0x0003B0F5 File Offset: 0x000392F5
		internal void OnLordRemoved(Hero lord)
		{
			this._lordsCache.Remove(lord);
			this.OnHeroRemoved(lord);
		}

		// Token: 0x06000A49 RID: 2633 RVA: 0x0003B10B File Offset: 0x0003930B
		internal void OnCompanionAdded(Hero companion)
		{
			this._companionsCache.Add(companion);
			this.OnHeroAdded(companion);
		}

		// Token: 0x06000A4A RID: 2634 RVA: 0x0003B120 File Offset: 0x00039320
		internal void OnCompanionRemoved(Hero companion)
		{
			this._companionsCache.Remove(companion);
			this.OnHeroRemoved(companion);
		}

		// Token: 0x06000A4B RID: 2635 RVA: 0x0003B136 File Offset: 0x00039336
		private void OnHeroAdded(Hero hero)
		{
			this._heroesCache.Add(hero);
			if (this._kingdom != null)
			{
				this._kingdom.OnHeroAdded(hero);
			}
		}

		// Token: 0x06000A4C RID: 2636 RVA: 0x0003B158 File Offset: 0x00039358
		private void OnHeroRemoved(Hero hero)
		{
			this._heroesCache.Remove(hero);
			if (this._kingdom != null)
			{
				this._kingdom.OnHeroRemoved(hero);
			}
		}

		// Token: 0x06000A4D RID: 2637 RVA: 0x0003B17B File Offset: 0x0003937B
		internal void OnWarPartyAdded(WarPartyComponent warPartyComponent)
		{
			this._warPartyComponentsCache.Add(warPartyComponent);
			if (this._kingdom != null)
			{
				this._kingdom.OnWarPartyAdded(warPartyComponent);
			}
		}

		// Token: 0x06000A4E RID: 2638 RVA: 0x0003B19D File Offset: 0x0003939D
		internal void OnWarPartyRemoved(WarPartyComponent warPartyComponent)
		{
			this._warPartyComponentsCache.Remove(warPartyComponent);
			if (this._kingdom != null)
			{
				this._kingdom.OnWarPartyRemoved(warPartyComponent);
			}
		}

		// Token: 0x06000A4F RID: 2639 RVA: 0x0003B1C0 File Offset: 0x000393C0
		internal void OnSupporterNotableAdded(Hero hero)
		{
			this._supporterNotablesCache.Add(hero);
		}

		// Token: 0x06000A50 RID: 2640 RVA: 0x0003B1CE File Offset: 0x000393CE
		internal void OnSupporterNotableRemoved(Hero hero)
		{
			this._supporterNotablesCache.Remove(hero);
		}

		// Token: 0x06000A51 RID: 2641 RVA: 0x0003B1E0 File Offset: 0x000393E0
		public void AddRenown(float value, bool shouldNotify = true)
		{
			if (value > 0f)
			{
				this.Renown += value;
				int num = Campaign.Current.Models.ClanTierModel.CalculateTier(this);
				if (num > this.Tier)
				{
					this.Tier = num;
					CampaignEventDispatcher.Instance.OnClanTierChanged(this, shouldNotify);
				}
			}
		}

		// Token: 0x06000A52 RID: 2642 RVA: 0x0003B235 File Offset: 0x00039435
		public void ResetClanRenown()
		{
			this.Renown = 0f;
			this.Tier = Campaign.Current.Models.ClanTierModel.CalculateTier(this);
			CampaignEventDispatcher.Instance.OnClanTierChanged(this, false);
		}

		// Token: 0x06000A53 RID: 2643 RVA: 0x0003B26C File Offset: 0x0003946C
		public void OnSupportedByClan(Clan supporterClan)
		{
			DiplomacyModel diplomacyModel = Campaign.Current.Models.DiplomacyModel;
			int influenceCostOfSupportingClan = diplomacyModel.GetInfluenceCostOfSupportingClan();
			if (supporterClan.Influence >= (float)influenceCostOfSupportingClan)
			{
				int influenceValueOfSupportingClan = diplomacyModel.GetInfluenceValueOfSupportingClan();
				int relationValueOfSupportingClan = diplomacyModel.GetRelationValueOfSupportingClan();
				ChangeClanInfluenceAction.Apply(supporterClan, (float)(-(float)influenceCostOfSupportingClan));
				ChangeClanInfluenceAction.Apply(this, (float)influenceValueOfSupportingClan);
				ChangeRelationAction.ApplyRelationChangeBetweenHeroes(supporterClan.Leader, this.Leader, relationValueOfSupportingClan, true);
			}
		}

		// Token: 0x06000A54 RID: 2644 RVA: 0x0003B2CC File Offset: 0x000394CC
		public static Clan CreateSettlementRebelClan(Settlement settlement, Hero owner, int iconMeshId = -1)
		{
			TextObject textObject = new TextObject("{=2LIV2cy7}{SETTLEMENT}{.o} rebels", null);
			textObject.SetTextVariable("SETTLEMENT", settlement.Name);
			Clan clan = Clan.CreateClan(settlement.StringId + "_rebel_clan", settlement, owner, settlement.MapFaction, settlement.Culture, textObject, Campaign.Current.Models.ClanTierModel.RebelClanStartingTier, iconMeshId);
			clan.IsRebelClan = true;
			return clan;
		}

		// Token: 0x06000A55 RID: 2645 RVA: 0x0003B338 File Offset: 0x00039538
		public static Clan CreateClan(string stringId, Settlement settlement, Hero owner, IFaction inheritingFaction, CultureObject culture, TextObject clanName, int tier, int iconMeshId = -1)
		{
			Clan clan = Clan.CreateClan(stringId);
			clan.InitializeClan(clanName, clanName, culture, Banner.CreateOneColoredBannerWithOneIcon(inheritingFaction.Banner.GetFirstIconColor(), inheritingFaction.Banner.GetPrimaryColor(), iconMeshId), settlement.GatePosition, false);
			clan.SetLeader(owner);
			clan.LabelColor = inheritingFaction.LabelColor;
			clan.Color = inheritingFaction.Color2;
			clan.Color2 = inheritingFaction.Color;
			clan.Tier = tier;
			clan.BannerBackgroundColorPrimary = settlement.MapFaction.Banner.GetFirstIconColor();
			clan.BannerBackgroundColorSecondary = settlement.MapFaction.Banner.GetFirstIconColor();
			clan.BannerIconColor = settlement.MapFaction.Banner.GetPrimaryColor();
			clan._midPointCalculated = false;
			clan._distanceToClosestNonAllyFortificationCacheDirty = true;
			clan.HomeSettlement = settlement;
			return clan;
		}

		// Token: 0x06000A56 RID: 2646 RVA: 0x0003B408 File Offset: 0x00039608
		public static Clan CreateCompanionToLordClan(Hero hero, Settlement settlement, TextObject clanName, int newClanIconId)
		{
			Clan clan = Clan.CreateClan(Hero.MainHero.MapFaction.StringId + "_companion_clan");
			clan.InitializeClan(clanName, clanName, settlement.Culture, Banner.CreateOneColoredBannerWithOneIcon(settlement.MapFaction.Banner.GetFirstIconColor(), settlement.MapFaction.Banner.GetPrimaryColor(), newClanIconId), settlement.GatePosition, false);
			clan.Kingdom = Hero.MainHero.Clan.Kingdom;
			clan.Tier = Campaign.Current.Models.ClanTierModel.CompanionToLordClanStartingTier;
			hero.Clan = clan;
			clan.SetLeader(hero);
			clan.IsNoble = true;
			ChangeOwnerOfSettlementAction.ApplyByGift(settlement, hero);
			CampaignEventDispatcher.Instance.OnCompanionClanCreated(clan);
			return clan;
		}

		// Token: 0x06000A57 RID: 2647 RVA: 0x0003B4C8 File Offset: 0x000396C8
		public MobileParty CreateNewMobileParty(Hero hero)
		{
			MobileParty result;
			if (hero.CurrentSettlement != null)
			{
				Settlement currentSettlement = hero.CurrentSettlement;
				if (hero.PartyBelongedTo != null && hero.PartyBelongedTo.IsMainParty)
				{
					PartyBase.MainParty.MemberRoster.RemoveTroop(hero.CharacterObject, 1, default(UniqueTroopDescriptor), 0);
				}
				result = MobilePartyHelper.SpawnLordParty(hero, currentSettlement);
			}
			else
			{
				MobileParty partyBelongedTo = hero.PartyBelongedTo;
				if (partyBelongedTo != null)
				{
					partyBelongedTo.AddElementToMemberRoster(hero.CharacterObject, -1, false);
				}
				result = MobilePartyHelper.SpawnLordParty(hero, (partyBelongedTo != null) ? partyBelongedTo.Position2D : SettlementHelper.GetBestSettlementToSpawnAround(hero).GatePosition, 5f);
			}
			return result;
		}

		// Token: 0x06000A58 RID: 2648 RVA: 0x0003B55F File Offset: 0x0003975F
		public MobileParty CreateNewMobilePartyAtPosition(Hero hero, Vec2 spawnPosition)
		{
			return MobilePartyHelper.SpawnLordParty(hero, spawnPosition, 5f);
		}

		// Token: 0x06000A59 RID: 2649 RVA: 0x0003B570 File Offset: 0x00039770
		public Dictionary<Hero, int> GetHeirApparents()
		{
			Dictionary<Hero, int> dictionary = new Dictionary<Hero, int>();
			int heroComesOfAge = Campaign.Current.Models.AgeModel.HeroComesOfAge;
			Hero leader = this.Leader;
			foreach (Hero hero in this.Heroes)
			{
				if (hero != this.Leader && hero.IsAlive && hero.DeathMark == KillCharacterAction.KillCharacterActionDetail.None && !hero.IsNotSpawned && !hero.IsDisabled && !hero.IsWanderer && !hero.IsNotable && hero.Age >= (float)heroComesOfAge)
				{
					int value = Campaign.Current.Models.HeirSelectionCalculationModel.CalculateHeirSelectionPoint(hero, this.Leader, ref leader);
					dictionary.Add(hero, value);
				}
			}
			if (leader != this.Leader)
			{
				Dictionary<Hero, int> dictionary2 = dictionary;
				Hero key = leader;
				dictionary2[key] += Campaign.Current.Models.HeirSelectionCalculationModel.HighestSkillPoint;
			}
			return dictionary;
		}

		// Token: 0x06000A5A RID: 2650 RVA: 0x0003B690 File Offset: 0x00039890
		private void UpdateBannerColorsAccordingToKingdom()
		{
			if (this.Kingdom != null)
			{
				Banner banner = this.Banner;
				if (banner != null)
				{
					banner.ChangePrimaryColor(this.Kingdom.PrimaryBannerColor);
				}
				Banner banner2 = this.Banner;
				if (banner2 != null)
				{
					banner2.ChangeIconColors(this.Kingdom.SecondaryBannerColor);
				}
				if (this.Kingdom.RulingClan == this)
				{
					Banner banner3 = this._banner;
					if (banner3 != null)
					{
						banner3.ChangePrimaryColor(this.Kingdom.PrimaryBannerColor);
					}
					Banner banner4 = this._banner;
					if (banner4 == null)
					{
						return;
					}
					banner4.ChangeIconColors(this.Kingdom.SecondaryBannerColor);
					return;
				}
			}
			else if (this.BannerBackgroundColorPrimary != 0U || this.BannerBackgroundColorSecondary != 0U || this.BannerIconColor != 0U)
			{
				Banner banner5 = this.Banner;
				if (banner5 != null)
				{
					banner5.ChangeBackgroundColor(this.BannerBackgroundColorPrimary, this.BannerBackgroundColorSecondary);
				}
				Banner banner6 = this.Banner;
				if (banner6 == null)
				{
					return;
				}
				banner6.ChangeIconColors(this.BannerIconColor);
				return;
			}
			else if (this.IsMinorFaction)
			{
				Banner banner7 = this.Banner;
				if (banner7 != null)
				{
					banner7.ChangePrimaryColor(this.Color);
				}
				Banner banner8 = this.Banner;
				if (banner8 == null)
				{
					return;
				}
				banner8.ChangeIconColors((this.Color != this.Color2) ? this.Color2 : uint.MaxValue);
			}
		}

		// Token: 0x06000A5B RID: 2651 RVA: 0x0003B7BB File Offset: 0x000399BB
		public void UpdateBannerColor(uint backgroundColor, uint iconColor)
		{
			this.BannerBackgroundColorPrimary = backgroundColor;
			this.BannerBackgroundColorSecondary = backgroundColor;
			this.BannerIconColor = iconColor;
		}

		// Token: 0x06000A5C RID: 2652 RVA: 0x0003B7D2 File Offset: 0x000399D2
		internal void DeactivateClan()
		{
			this._isEliminated = true;
		}

		// Token: 0x06000A5D RID: 2653 RVA: 0x0003B7DB File Offset: 0x000399DB
		string IFaction.get_StringId()
		{
			return base.StringId;
		}

		// Token: 0x06000A5E RID: 2654 RVA: 0x0003B7E3 File Offset: 0x000399E3
		MBGUID IFaction.get_Id()
		{
			return base.Id;
		}

		// Token: 0x040002C5 RID: 709
		[SaveableField(54)]
		private PartyTemplateObject _defaultPartyTemplate;

		// Token: 0x040002CA RID: 714
		[SaveableField(97)]
		private bool _isEliminated;

		// Token: 0x040002CB RID: 715
		[SaveableField(99)]
		private MBList<CharacterObject> _minorFactionCharacterTemplates;

		// Token: 0x040002CC RID: 716
		[CachedData]
		private MBList<Hero> _supporterNotablesCache;

		// Token: 0x040002CD RID: 717
		[SaveableField(57)]
		private Kingdom _kingdom;

		// Token: 0x040002CE RID: 718
		[CachedData]
		private MBList<Town> _fiefsCache;

		// Token: 0x040002CF RID: 719
		[CachedData]
		private MBList<Village> _villagesCache;

		// Token: 0x040002D0 RID: 720
		[CachedData]
		private MBList<Settlement> _settlementsCache;

		// Token: 0x040002D1 RID: 721
		[CachedData]
		private MBList<Hero> _lordsCache;

		// Token: 0x040002D2 RID: 722
		[CachedData]
		private MBList<Hero> _heroesCache;

		// Token: 0x040002D3 RID: 723
		[CachedData]
		private MBList<Hero> _companionsCache;

		// Token: 0x040002D4 RID: 724
		[CachedData]
		private MBList<WarPartyComponent> _warPartyComponentsCache;

		// Token: 0x040002D5 RID: 725
		[SaveableField(62)]
		private float _influence;

		// Token: 0x040002E9 RID: 745
		[CachedData]
		private Settlement _clanMidSettlement;

		// Token: 0x040002EB RID: 747
		[SaveableField(82)]
		private CharacterObject _basicTroop;

		// Token: 0x040002EC RID: 748
		[SaveableField(83)]
		private Hero _leader;

		// Token: 0x040002ED RID: 749
		[SaveableField(84)]
		private Banner _banner;

		// Token: 0x040002F1 RID: 753
		[SaveableField(91)]
		private int _tier;

		// Token: 0x040002F3 RID: 755
		[SaveableField(120)]
		private float _aggressiveness;

		// Token: 0x040002F4 RID: 756
		[SaveableField(130)]
		private int _tributeWallet;

		// Token: 0x040002F5 RID: 757
		[SaveableField(95)]
		private Settlement _home;

		// Token: 0x040002F6 RID: 758
		[SaveableField(110)]
		private int _clanDebtToKingdom;

		// Token: 0x040002F7 RID: 759
		[CachedData]
		private List<StanceLink> _stances;

		// Token: 0x040002F8 RID: 760
		[CachedData]
		private float _distanceToClosestNonAllyFortificationCache;

		// Token: 0x040002F9 RID: 761
		[CachedData]
		internal bool _distanceToClosestNonAllyFortificationCacheDirty = true;
	}
}
